var Jaxertal = {
	
	templatePath : "",
	
	setTepmplateDir : function(path){
		if(Jaxer.Dir.exists(path)){
			if(path.lastIndexOf('/') < path.length-1) path +='/';
			this.templatePath = path;
		} else {
			throw new Error('Template directory not found: ' + path);
		}
	},
	
	loadTemplate : function(path){
		path = this.templatePath + path;
		if( Jaxer.File.exists(path) ){
			try {
				var tpl = Jaxer.File.read(path)
				return tpl;
			} catch(e) {
				throw new Error(e + "\n using template file "+ path);
			}
		} else throw new Error('template file not found: ' + path);
		
	}
	
};

var JSTALUtils = {
	
	loadMacro : function( path ){
		return Jaxertal.loadTemplate( path );
	}
	
}
